﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package net.wooga.pets.controllers.world {
    import net.wooga.pets.loading.vos.*;
    import net.wooga.pets.events.*;
    import net.wooga.pets.models.*;
    import net.wooga.pets.interfaces.*;
    import net.wooga.pets.constants.*;
    import org.robotlegs.mvcs.*;

    public class DismissCuredPatientCommand extends Command {

		[Inject]
        public var event:InfoEvent;
		[Inject]
        public var user:UserModel;

        override public function execute():void{
            var _local1:RequestEvent;
            l(("execute: " + this.execute));
            if (!this.user.isVisitFriendsMode()){
                _local1 = new RequestEvent(EventConstants.SEND_REQUEST, this.onDismiss);
                _local1.addRequest("dismiss_patient", {id:this.event.id});
                dispatch(_local1);
            };
        }
        private function onDismiss(_arg1:ResultVO):void{
            var _local2:ITreatable;
            l(("onDismiss: " + this.onDismiss));
            if (_arg1.success){
                _local2 = (this.event.info as ITreatable);
                if (_local2){
                    _local2.dismissed = true;
                };
            };
        }

    }
}//package net.wooga.pets.controllers.world 
